﻿using System;
using System.Collections.Generic;
using System.Web;
using RicciWebsite;
using Hxj.Common;

namespace RicciWebsite.Pages
{
    public class PageBase : System.Web.UI.Page//Hxj.Web.Pages.UrlRewritePage
    {

        /// <summary>
        /// 设置语言
        /// </summary>
        protected override void InitializeCulture()
        {
            RicciWebsite.Common.Language lan = RicciWebsite.Common.GetLanguage();

            switch (lan)
            {
                case RicciWebsite.Common.Language.SampleChinese:
                    System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("zh-CN");
                    System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("zh-CN");
                    break;
                case RicciWebsite.Common.Language.TraditionalChinese:
                    System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("zh-CN");
                    System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("zh-CN");
                    break;
                case RicciWebsite.Common.Language.English:
                    System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
                    System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-US");
                    break;
                default:
                    break;
            }

            base.InitializeCulture();
        }


        /// <summary>
        /// 设置主题
        /// </summary>
        /// <param name="e"></param>
        protected override void OnPreInit(EventArgs e)
        {
            this.Theme = "default";

            base.OnPreInit(e);

            //设置标题
            this.Title = Hxj.Common.Utils.GetAppSettingString("websitename");
        }
    }
}
